package org.aplikator.client.command;

import org.aplikator.client.widgets.TextFieldWidget;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;

@SuppressWarnings("serial")
public class CreateEntity extends BindableCommand {


    public CreateEntity() {
        super();
    }

    @Override
    public void execute() {
        if (contents == null) {
            VerticalPanel vSplit = new VerticalPanel();
            // vSplit.ensureDebugId("cwVerticalSplitPanel");
            // vSplit.setSize("100%", "100%");

            vSplit.add(new TextFieldWidget<String>("Field1", null, false, null));
            vSplit.add(new TextFieldWidget<String>("Field2", null, false, null));
            vSplit.add(new Button("Save"));
            SimplePanel decPanel = new SimplePanel();
            // decPanel.setSize("100%", "100%");
            decPanel.setWidget(vSplit);

            // mainPanel.add(decPanel, new
            // ClosableTab(tabName,decPanel,mainPanel, null));
            // mainPanel.selectTab(mainPanel.getWidgetCount()-1);
            contents = decPanel;
        }
        mainPanel.setContents(contents);

    }

}
